Skip to content

Conversation

@dersam
Copy link
Contributor

@dersam dersam commented Oct 4, 2025

Second part of new Roast architecture. Sorbet typechecking will be used as a way to statically validate Roast workflows. Between Ruby syntax checking and Sorbet static analysis, we should be able to completely eliminate the frustrating syntax gotchas with the current default YAML workflow definitions.

Note: RBI shims are a placeholder, these will be replaced in the future with a tapioca compiler that will be able to generate RBIs for any cog.

I experimented with generics to apply types, but it ended up requiring the writing of some really ugly code. RBI generation with tapioca gives more idiomatic Ruby code while still providing the validations we want to supply.

@dersam dersam mentioned this pull request Oct 4, 2025
Copy link
Contributor Author

dersam commented Oct 4, 2025

@dersam dersam force-pushed the 10-04-set_up_typechecking_for_dsl_blocks branch 3 times, most recently from 6e28202 to 9449467 Compare October 5, 2025 17:22
@completed ||= false
end

#: { () [self: ConfigContext] -> void} -> void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RBS type is what allows us to transparently rebind the self of the config and execute blocks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this

module Roast
module DSL
class ConfigContext
#: (?Symbol?) {() [self: Roast::DSL::Cogs::Cmd::Config] -> void} -> void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handwriting RBIs is a stopgap - I'll investigate doing this via a Tapioca compiler next, which will also give the same benefits to third party cogs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it makes sense to get it working first in a bare-bones way before investing in automation

@dersam dersam marked this pull request as ready for review October 5, 2025 17:24
Copy link
Contributor Author

dersam commented Oct 7, 2025

Merge activity

  • Oct 7, 7:17 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 7, 7:20 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 7, 7:20 PM UTC: @dersam merged this pull request with Graphite.

@dersam dersam changed the base branch from 10-03-set_up_cog_executor_with_dsl to graphite-base/419 October 7, 2025 19:18
@dersam dersam changed the base branch from graphite-base/419 to main October 7, 2025 19:18
@dersam dersam force-pushed the 10-04-set_up_typechecking_for_dsl_blocks branch from 9449467 to 4bc20f6 Compare October 7, 2025 19:19
@dersam dersam merged commit 653642e into main Oct 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants